require(["common", "jQuery", "coAjax", "queryString", "hash_routie", "js/pages/admin/goods-details"], function(jSouper, $, coAjax, QueryString, hash_routie, goods_detail) {

	// 载入商品信息
	hash_routie.on("update_goods", function() {
		var goods_to_update = App.get("$Cache.goods_to_update");
		if (goods_to_update) {
			goods_detail.init(goods_to_update)
		} else {
			queryString = new QueryString(location.hash);
			showLoader();
			coAjax.get(appConfig.goods.detail + queryString.get("id"), function(result) {
				goods_detail.init(result.result);
				removeLoader();
			});
		}
	});

	App.set("$Event.shelves.put_goods", function(e) {
		goods_detail.upload_goods("update");
	});

});